import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { WxUser } from '../../wxuser/entities/wxuser.entity'; // 假设存在 User 实体
import { Topic } from '../../topic/entities/topic.entity';

@Entity()
export class Favorite {
  @PrimaryGeneratedColumn()
  id: number;

  @ManyToOne(() => WxUser)
  user: WxUser;

  @ManyToOne(() => Topic)
  topic: Topic;

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  createdAt: Date;
}
